package com.twu.biblioteca.Models;

import java.util.Collection;
import java.util.HashMap;

/**
 * Created with IntelliJ IDEA.
 * User: Aru
 * Date: 5/24/13
 * Time: 2:57 PM
 * To change this template use File | Settings | File Templates.
 */
public class MovieCollection
{
    private HashMap<String,Movie> movieList = new HashMap<String, Movie>();

    public MovieCollection()
    {
        movieList.put("Star Trek Into Darkness", new Movie("Star Trek Into Darkness",2013,"JJ Abrams","8"));
        movieList.put("Iron Man 3", new Movie("Iron Man 3",2013,"Shane Black","7"));
        movieList.put("The Great Gatsby", new Movie("The Great Gatsby",2013,"Baz Luhrmann","7.5"));
        movieList.put("Pain & Gain", new Movie("Pain & Gain",2013,"Micheal Bay","6"));
        movieList.put("The Croods", new Movie("The Croods",2013,"Chris Sanders","7"));
        movieList.put("The Hangover Part III", new Movie("The Hangover Part III",2013,"Todd Philips","6"));
        movieList.put("Before Midnight", new Movie("Before Midnight",2013,"Richard Linklater","N/A"));
        movieList.put("Flight", new Movie("Flight",2012,"Adamm","6"));
        movieList.put("Madagascar", new Movie("Madagascar",2005,"Eric","8"));
        movieList.put("Godfather", new Movie("Godfather",1972,"Francis","9"));
        movieList.put("Scarface", new Movie("Scarface",1983,"Brian","8"));
        movieList.put("Se7en", new Movie("Se7en",1995,"David","8"));
        movieList.put("Jaws", new Movie("Jaws",1973,"Abrams","8"));
        movieList.put("Taxi Driver", new Movie("Taxi Driver",1976,"Martin","8"));
        movieList.put("Star Wars", new Movie("Star Wars",1977,"JJ Abrams","8"));
    }

    public void displayMovieList()
    {
        for (String key : movieList.keySet())
        {
            Movie movie = movieList.get(key);
            System.out.println(movie.getMovieName());
        }
    }

    public Movie returnMovie(String movieName)
    {
        Movie movie = null;
        if(movieList.containsKey(movieName))
        {
            movie= movieList.get(movieName);
        }
        return movie;
    }
}
